#ifndef TEST_STATE_H
#define TEST_STATE_H

#include "GameManager.h"
#include "Button.h"

class TestState : public State
{
public:
    TestState(): m_button(100, 100, 32, 32)
    {
        m_image.LoadFromFile("test.png");
        m_sprite.SetImage(m_image);
        m_sprite.SetPosition(100.f, 100.f);
    }
    ~TestState(){}

    void init(int id)
    {
        m_id = id;
    }

    void handleEvents(GameManager* m)
    {
        m_button.handleEvents(m);


       // if(m_button.clicked())
            //m->quit();
        if (m->getEvent().Type == sf::Event::Closed)
            m->quit();

        // Escape key pressed
        if ((m->getEvent().Type == sf::Event::KeyPressed) && (m->getEvent().Key.Code == sf::Key::Escape))
            m->quit();

    }

    void update(GameManager* m)
    {

    }

    void render(GameManager* m)
    {
        m->draw(m_sprite);
        m_button.render(m);
    }

private:
    Button m_button;
    sf::Image m_image;
    sf::Sprite m_sprite;
    sf::Event m_event;


};

#endif
